#ifndef __WATCH_DOG_H
#define __WATCH_DOG_H
#include "types.h"

 /* registers */
 
#define WD_Counter					0x0
#define WD_Load						0x4
#define WD_Restart					0x8
#define WD_CR						0xC
#define WD_Status					0x10
#define WD_Clear					0x14
#define WD_Intrlen					0x18


 /* control registers */
 
#define WdEnable					0x1
#define WdReset						0x2
#define WdIntEnable					0x4
#define WdExtEnable					0x8
#define WdClock						0x10


#define WD_AUTO_RELOAD 				0x5AB9


/*  -------------------------------------------------------------------------------
 *   API
 *  -------------------------------------------------------------------------------
 */


extern void fLib_WatchDog_Enable(void);
extern void fLib_WatchDog_Disable(void);
extern void fLib_WatchDog_ReStart(void);
//extern void fLib_WatchDog_SetAutoReLoad(UINT32 value);
extern void fLib_WatchDog_SetAutoReLoad(UINT32);

extern void fLib_WatchDog_SysIntEnable(void);
extern void fLib_WatchDog_SysIntDisable(void);
extern void fLib_WatchDog_SysResetEnable(void);
extern void fLib_WatchDog_SysResetDisable(void);

extern UINT32 fLib_WatchDog_ReadCounter(void);
extern void fLib_WatchDog_ClearStatus(void);
//extern void fLib_WatchDog_SetIntCounter(UINT8 Counter);
extern void fLib_WatchDog_SetIntCounter(UINT8);

extern BOOL fLib_WatchDog_IsCounterZero(void);
extern void WatchDogStart(UINT32 reload_sec);

#endif // __WATCH_DOG_H
